﻿using System;
using System.Linq.Expressions;
using Sharp.Domain.Model;

namespace Sharp.Domain
{
    /// <summary>
    /// 查询模型
    /// </summary>
    /// <typeparam name="TKey"></typeparam>
    /// <typeparam name="TAggregateRoot"></typeparam>
    public class RepositoryQueryModel<TKey, TAggregateRoot> where TAggregateRoot : class,
        IAggregateRoot<TKey> where TKey : struct
    {
        /// <summary>
        /// 过滤条件描述
        /// </summary>
        public Expression<Func<TAggregateRoot, bool>> Predicate { get; set; }
        /// <summary>
        /// 获取顶部多少数据量
        /// </summary>
        public int? Top { get; set; }
        /// <summary>
        /// 饥饿加载描述
        /// </summary>
        public string[] EagerLoadingProperties { get; set; }
        /// <summary>
        /// 饥饿加载描述
        /// </summary>
        public Expression<Func<TAggregateRoot, dynamic>>[] EagerLoadingPropertiesB { get; set; }
        /// <summary>
        /// 排序描述
        /// </summary>
        public string SortPredicate { get; set; }

    }
}